package model;

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.mysql.jdbc.Connection;

public class DataDAO {
	ResultSet rs = null;
	Statement stmt = null;

	private String server = "localhost";
	private String port = "3306";
	private String database = "pumpkin_task13";
	private String driverName = "com.mysql.jdbc.Driver";
	private String conURL = "jdbc:mysql://" + server + ":" + port + "/"
			+ database;
	
	public DataDAO(){
		
	}
	
	public Connection getconn(){
		Connection conn = null;
		
		try {
			Class.forName(driverName);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}

		try {
			conn = (Connection) DriverManager.getConnection(conURL);
			System.out.println("Connection Successful!!");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return conn;
	}
}
